Fix Across Predict withdraw gas payment edges#8762
Open
pedronfigueiredo wants to merge 1 commit into
Open
Conversation
aeb6df5 to
b942291
Compare
This was referenced May 11, 2026
0e2bce3 to
013d596
Compare
b942291 to
84b56cb
Compare
013d596 to
2b8de19
Compare
84b56cb to
02d07d3
Compare
pull Bot
pushed a commit
to dmrazzy/core
that referenced
this pull request
May 12, 2026
## Summary This is PR 1 of 4 in the core stack for Predict withdraws over Across. - Adds `TransactionType.predictAcrossWithdraw`. - Treats `isPostQuote` requests as actionable for Across support checks. - Allows source-chain authorization lists only for post-quote Predict withdraw detection, where the original withdraw is not encoded as an Across destination action. - Generalizes transaction-pay refund documentation from Relay-only language to quote-provider language. ## Stack 1. This PR: plumbing to identify Predict Across withdraws 2. MetaMask#8760: quote support 3. MetaMask#8761: submit support 4. MetaMask#8762: gas payment edge cases ## Validation - `yarn workspace @metamask/transaction-pay-controller run jest --no-coverage src/strategy/across/AcrossStrategy.test.ts` - Full stack validation was run on the final stacked branch: - `yarn changelog:validate` - `yarn workspace @metamask/transaction-pay-controller run test` - `yarn workspace @metamask/transaction-controller run test` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes Across quote eligibility logic to treat `isPostQuote` requests as actionable and to allow EIP-7702 `authorizationList` only for a specific Predict-withdraw post-quote path; misclassification could incorrectly enable/disable Across quoting for some transactions. > > **Overview** > Introduces a new `TransactionType.predictAcrossWithdraw` to tag Predict withdraws that will use Across. > > Updates `AcrossStrategy.supports` to treat `isPostQuote` quote requests as actionable and only accept them when the original transaction is a Predict withdraw, plus adds `hasUnsupportedTransactionAuthorizationList` to block EIP-7702 `authorizationList` usage except for the Predict-withdraw post-quote detection case. Tests were extended to cover post-quote Predict withdraw handling. > > Minor docs/logic tweaks: `isAcrossQuoteRequest` now includes `isPostQuote`, and `refundTo` comments were generalized from Relay-specific wording to quote-provider wording. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit fc6f92e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
2b8de19 to
0d353f0
Compare
02d07d3 to
17befc5
Compare
0d353f0 to
131e283
Compare
17befc5 to
edb756c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is PR 4 of 4 in the core stack for Predict withdraws over Across.
Stack
Validation
yarn workspace @metamask/transaction-pay-controller run jest --no-coverage src/strategy/across/across-quotes.test.ts src/strategy/across/across-submit.test.ts src/strategy/across/AcrossStrategy.test.tsyarn workspace @metamask/transaction-controller run jest --no-coverage src/utils/gas-fee-tokens.test.tsyarn changelog:validateyarn workspace @metamask/transaction-pay-controller run testyarn workspace @metamask/transaction-controller run testNote
Medium Risk
Touches gas-fee token selection and Across quote gas/fee calculations; mistakes could cause incorrect fee-token usage or failed submissions, but changes are localized and well-covered by new tests.
Overview
Fixes
TransactionControllerpre-publish handling of selected gas fee tokens to respectexcludeNativeTokenForFee(skip native-balance checks, forceisExternalSign, and clear nonce) and adds coverage for this path.Improves
transaction-pay-controllerAcross post-quote Predict-withdraw quoting by capping inflated prefunded 7702 batch gas to the configured Across fallback, falling back to relaxed per-transaction estimates when batch simulation fails, and preferring source-token gas pricing for Predict-withdraws (including a fiat-rate-derived fallback when gas-station can’t price the source token). It also hardens gas-station token lookup when gas-fee-token estimation fails.Reviewed by Cursor Bugbot for commit edb756c. Bugbot is set up for automated code reviews on this repo. Configure here.